//
//  UIColor+addition.m
//  AVFoundationDemo
//
//  Created by zl on 2019/12/9.
//  Copyright © 2019 LG. All rights reserved.
//

#import "UIColor+addition.h"

@implementation UIColor (addition)

- (UIColor *)darkerColor {
    CGFloat hue, saturation, brightness, alpha;
    if([self getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha]) {
        return [UIColor colorWithHue:hue saturation:saturation brightness:MIN(brightness * 1.3, 1.0) alpha:0.5];
    }
    return nil;
}
- (UIColor *)lighterColor {
    CGFloat hue, saturation, brightness, alpha;
    if([self getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha]) {
        return [UIColor colorWithHue:hue saturation:saturation brightness:brightness*0.92 alpha:alpha];
    }
    return nil;
}

@end
